﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Net;

namespace ZenHR.AttData.Package.Util
{
    public class TWebClient : WebClient
    {

        /// <summary>  
        /// 过期时间  
        /// </summary>  
        public int Timeout { get; set; }

        public TWebClient(int timeout = 1000 * 30)
        {

            Timeout = timeout;
        }

        protected override WebRequest GetWebRequest(Uri address)
        {
            var request = (HttpWebRequest)base.GetWebRequest(address);

            request.Timeout = Timeout;
            request.ReadWriteTimeout = Timeout;
            return request;
        }

    }
}
